const webpack = require("webpack");
const Timestamp = new Date().getTime();
console.log(process.env.VUE_APP_BASE_API);
module.exports = {
  publicPath: "./",
  outputDir: process.env.outputDir,
  configureWebpack: {
    // webpack 配置
    output: {
      // 输出重构  打包编译后的 文件名称  【模块名称.版本号.时间戳】
      filename: `js/[name].${Timestamp}.js`,
      chunkFilename: `js/[name].${Timestamp}.js`,
    },
  },
  productionSourceMap: process.env.NODE_ENV === "production" ? false : true,
  // devServer: {
  //     proxy: {
  //         '/api':{
  //             target:'http://jsonplaceholder.typicode.com',
  //             changeOrigin:true,
  //             pathRewrite:{
  //                 '/api':''
  //             }
  //         }
  //     }
  // }
  css: {
    loaderOptions: {
      sass: {
        prependData: `@import "@/assets/css/_globals.scss";`,
      },
    },
  },
  devServer: {
    host: "0.0.0.0",
  },
};
